<template>
    <div class="agreement-wrap">
        <my-header></my-header>
        <iframe :src="file_path" :style="{ width: iframe.width, height: iframe.height }" />
    </div>
</template>
<style lang="scss" scoped>
    .agreement-wrap {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        & > iframe {
            padding-top: .9rem;
        }
    }
</style>
<script>
    import { PROTOCOL_PATH } from 'config'
    import MyHeader from 'components/myHeader'

    export default {
        name: 'PreviewProtocol',
        data() {
            return {
                // http://127.0.0.1:8082/viewer.html?file=3028_1.pdf
                file_path: `${PROTOCOL_PATH}/viewer.html?file=${decodeURIComponent(this.$route.params.file)}`,
                iframe: {
                    width: '100%',
                    height: `${document.documentElement.clientHeight}px`
                }
            }
        },
        components: {
          MyHeader
        }
    }
</script>